package com.install.core.service;

import javax.servlet.ServletContext;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
/***
 * 
 * @author pk 2013-01-15
 *
 */
public class SpringApplicationContext {
	private static ApplicationContext context=null;
	public static ApplicationContext getInstance(){
		if(context==null)
		context=new ClassPathXmlApplicationContext("applicationContext.xml");
		return context;
	}
	public static ApplicationContext getInstance(ServletContext sc){
		if(context==null)
		context=WebApplicationContextUtils.getWebApplicationContext(sc);
		return context;
	}
}
